﻿namespace NJQuery {
	using System;
	using System.Web.UI;
	using System.ComponentModel;

	/// <summary>
	/// Provides core functionality that can be extended by various specific script-generating controls to generate blocks of client jQuery script.
	/// </summary>
	[ParseChildren(true), PersistChildren(false)]
	public class ScriptDef : ManagedControl {


		#region Constructors

		/// <summary>
		/// Initializes a new instance of the <see cref="ScriptDef"/> class.
		/// </summary>
		protected ScriptDef() { }

		#endregion


		#region Properties

		/// <summary>
		/// Gets or sets the contents of the script.
		/// </summary>
		[PersistenceMode(PersistenceMode.InnerProperty), DefaultValue(""), Category("Behavior")]
		public virtual string Definition {
			get { return ViewState["Definition"] as string ?? string.Empty; }
			set { ViewState["Definition"] = value; }
		}

		#endregion


	}

}